package com.boot.unity.api.modules.training.controller;

import com.boot.unity.api.common.Result;
import com.boot.unity.api.modules.training.entity.ChargeStandard;
import com.boot.unity.api.modules.training.service.ChargeStandardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

//@Api(tags = "驾校-收费标准")
//@RestController
//@RequestMapping("/api/charStandard")
@AllArgsConstructor
public class ChargeStandardController {
    private final ChargeStandardService chargeStandardService;

    @PostMapping
    @ApiOperation(value = "备案及修改收费标准")
    public Result save(@RequestBody ChargeStandard chargeStandard) {
        return chargeStandardService.save(chargeStandard);
    }

    @ApiOperation(value = "删除收费标准")
    @DeleteMapping("/{inscode}- CharStandard -{seq}")
    public Result delete(@PathVariable("inscode") String inscode,@PathVariable("seq") Integer seq) {
        return chargeStandardService.deleteByInscodeAndSeq(inscode,seq);
    }

//    @GetMapping("/{id}")
//    @ApiOperation(value = "根据id获取")
//    public ChargeStandard get(@PathVariable Long id) {
//        return chargeStandardDao.getById(id);
//    }
//
//    @PutMapping
//    @ApiOperation(value = "修改")
//    public ChargeStandard update(@RequestBody ChargeStandard chargeStandard) {
//        chargeStandardDao.update(chargeStandard);
//
//        return chargeStandard;
//    }
//
//    @GetMapping
//    @ApiOperation(value = "列表")
//    public PageTableResponse list(PageTableRequest tableRequest) {
//        return new PageTableHandler(
//            request -> chargeStandardDao.count(request.getParams()),
//            request -> chargeStandardDao.list(request.getParams(), request.getOffset(), request.getLimit())
//        ).handle(tableRequest);
//    }


}
